; This file is the part of the Textator project
; Last changed: $Id: diz_print.asm 80 2009-12-08 11:06:54Z vitamin.caig $
; (C) Vitamin/CAIG/2001

; Specifies functions, which is able to print packed (dizpack) text
; via external output function

; SjASM format used

; Print dizpacked string
; In: hl - text address
; Function StrOutChar should be defined

StrPrint
        ld b,1
        ld d,high _DIZPACK_ ;must be defined
SymCycle
        ld e,0
NibbleCycle
        djnz NoNibbles
        ld b,2
        ld a,(hl)
        and 15
        ld c,a
        xor (hl)
        inc hl
        rra
        rra
        rra
        rra
NoNibbles
        cp 15
        jr z,NextNibble
        add a,e
        ld e,a
        ld a,(de)
        and a
        ret z  ;end
        call StrOutChar ;external
        jr SymCycle
NextNibble
        add a,e
        ld e,a
        ld a,c
        jr NibbleCycle
